package com.sky.mapper;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author hyh
 * @version 1.0
 */
@Mapper
public interface OrdersDetailMapper {
    /**
     * 订单细节插入数据
     * @param orderDetail
     */
    @Insert("insert into order_detail (name, image, order_id, dish_id, setmeal_id, dish_flavor, amount) " +
            "values (#{name},#{image},#{orderId},#{dishId},#{setmealId},#{dishFlavor},#{amount})")
    void insert(OrderDetail orderDetail);

    /**
     * 根据订单id来查询
     * @param id
     * @return
     */
    List<OrderDetail> selectByOrderId(@Param("id") Long id);

}
